package com.aoxin.controller.client;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aoxin.service.inter.client.RecentlyMadeReservationsService;
import com.aoxin.util.AjaxRes;
import com.aoxin.util.Const;

@RestController
@RequestMapping("/web/recentlyMadeReservations/")
public class RecentlyMadeReservationsController {
		@Autowired
		RecentlyMadeReservationsService recentlyMadeReservationsService;
		
		/**
		 * 获取最近预约数据
		 * @param ajaxRes
		 * @return
		 */
		@RequestMapping("checkLimitRecentlyMadeReservations")
		public AjaxRes checkLimitRecentlyMadeReservations(AjaxRes ajaxRes) {
			try {
				List<Map<String, Object>> courseOrPageData = recentlyMadeReservationsService.checkLimitRecentlyMadeReservations();
				ajaxRes.setSucceed(courseOrPageData, Const.DATA_SUCCEED);
			} catch (Exception e) {
				ajaxRes.setFailMsg(e.getMessage());
			}
			return ajaxRes;
		}
}
